import React from "react"
import { BrowserRouter as Router, Route, Switch, Redirect } from 'react-router-dom'

// 引入路由组件
import Home from './pages/Home/index.jsx'
import CityList from "./pages/CityList"
import Map from "./pages/Map"

function App() {
  return (
    <Router>
      <div className="App">
        {/* 配置路由 */}
        <Switch>
          <Route path="/" exact render={() => <Redirect to="/home" />} />
          <Route path="/home" component={Home} />
          <Route path="/citylist" component={CityList} />
          <Route path="/map" component={Map} />
        </Switch>
      </div>
    </Router>
  )
}

export default App
